/** 窗口基类 */
cc.Class({
    extends: cc.Component,

    properties: {
        /** 关闭按钮 */
        sp_close:cc.Sprite,
        /** 帮助按钮 */
        sp_help:cc.Sprite,
        /** 窗口标题 */
        txt_title:cc.Label,
        /** 内容节点 */
        nd_con:cc.Node,
    },

    // LIFE-CYCLE CALLBACKS:

    onLoad () {
        this.sp_close.node.on(cc.Node.EventType.TOUCH_END, function(ev){
            this.node.parent.parent = null;
        }, this);
        this.node.parent.x = -100;
    },

    start () {

    },
    /** 设置信息 */
    setInfo(w,h,t){
        w && (this.node.width = w);
        h && (this.node.height = h);
        this.txt_title.string = t;
        this.nd_con.width = this.node.width - 10;
        this.nd_con.height = this.node.height - 30;
        this.nd_con.x = 0;
        this.nd_con.y = (this.node.height - 30) / 2 - 10;
    },
    // update (dt) {},
});
